// 入口文件
// 导入混合文件
@import "./mixins.less";
// 导入初始化样式
@import "./reset.less";
// 导入变量文件
@import "./variables.less";

// 整体样式设置
.container {
    margin: 0 auto;
    width: 1200px;
}

// topbar
.topbar {
    min-width: 1200px;
    height: 30px;
    line-height: 30px;
    background: #eaeaea;

    .container {
        display: flex;
        justify-content: space-between;

        a {
            padding: 0 10px;

            &:not(:last-child) {
                border-right: 1px solid @sep-color;
            }
        }

    }
}

// log和搜索框
.page-header {
    min-width: 1200px;

    .container {
        display: flex;
        justify-content: space-between;

        .log {
            width: 175px;
            height: 56px;
            margin: 25px 45px;

        }

        form {
            margin-top: 35px;
            display: flex;

            input {

                box-sizing: border-box;
                width: 490px;
                height: 32px;
                padding: 0 4px;
                outline: none;
                border: 2px solid @form-red;
            }

            button {
                width: 68px;
                height: 32px;
                background: @form-red;
                color: #fff;
                border: none;
            }
        }
    }

}

// 页面导航
.page-nav {
    min-width: 1200px;
    border-bottom: 2px solid @btn-red;

    .container {
        height: 50px;
        line-height: 50px;
        display: flex;

        .all-cates {
            h2 {
                width: 210px;
                text-align: center;

                background-color: @btn-red;
                color: #fff;
                font-size: 14px;
            }


        }

        nav {
            display: flex;

            a {

                margin: 0px 22px;
                font-size: 16px;
                color: #333;
            }

        }
    }
}

// 页面主要内容导航
.page-main {
    min-width: 1200px;
    margin-top: 15px;

    // 路径导航
    .path-nav {
        display: flex;
        padding: 9px 15px 9px 0;

        span {
            &:not(:last-child)::after {
                content: "/\00a0";
                padding: 0 5px;
                color: #ccc;
            }
        }
    }

    // 放大镜和商品参数选项
    .product {
        display: flex;
        justify-content: space-between;
        margin: 5px 0 15px;

        .product-preview {
            width: 400px;

            .zoom-box {
                position: relative;

                .small-image {
                    cursor: move;
                    width: 400px;
                    height: 400px;
                    border: 1px solid #dfdfdf;

                    .mask-box {
                        display: none;
                        position: absolute;
                        left: 0px;
                        top: 0px;
                        box-sizing: border-box;
                        width: 200px;
                        height: 200px;
                        border: 1px solid #ddd;
                        background: rgba(255, 255, 255, 0.5);
                    }

                }

                .large-image {
                    display: none;
                    position: absolute;
                    left: 420px;
                    top: 0px;
                    width: 400px;
                    height: 400px;
                    overflow: hidden;
                    border: 1px solid #dfdfdf;
                }
            }

            // 缩略图
            .thumb-box {
                margin-top: 5px;
                display: flex;
                justify-content: space-between;

                button {
                    width: 10px;
                    height: 54px;
                    border: 1px solid #ccc;
                    background: #ebebeb;

                    &.thumb-prev {
                        margin-right: 4px;
                    }
                }

                .thumb-content {
                    position: relative;
                    width: 372px;
                    height: 56px;
                    overflow: hidden;

                    .thumb-wrapper {
                        position: absolute;
                        left: 0px;
                        top: 0px;
                        display: flex;
                        transition: left 300ms;

                        img {
                            width: 50px;
                            height: 50px;
                            border: 1px solid #ccc;
                            padding: 2px;
                            margin-right: 20px;
                        }
                    }
                }
            }
        }

        // 商品参数选项
        .product-box {
            width: 700px;

            .product-price {
                padding-bottom: 5px;
                border-bottom: 1px solid #ededed;

                .product-title {
                    margin-top: 15px;
                    font-size: 14px;
                    line-height: 21px;
                }

                .product-message {
                    margin-top: 15px;
                    color: #e12228;
                }

                .price-area {
                    margin-top: 10px;
                    padding: 7px;
                    line-height: 28px;
                    background-color: #fee9ec;

                    .price-row {

                        .clearfix();

                        .price-title {
                            float: left;
                            margin-right: 15px;
                        }

                        .price-content {
                            float: left;
                        }

                        .comment {
                            float: right;
                        }

                        &:first-child {

                            .price-content {
                                color: #cc1122;

                                .icon {
                                    font-size: 16px;
                                }

                                .price {
                                    font-size: 24px;
                                    font-weight: 700;
                                }

                                .low {
                                    font-size: 12px;
                                }
                            }
                        }

                        &:last-child {
                            margin-top: 10px;

                            .price-content {
                                .tag {
                                    padding: 3px;
                                    color: #fff;
                                    background-color: #c81623;
                                }
                            }
                        }

                    }
                }

                .support-row {
                    display: flex;
                    margin-top: 10px;
                    line-height: 28px;

                    .support-title {
                        margin-right: 15px;
                    }

                    .supoort-content {
                        width: 520px;
                        color: #999;
                    }
                }
            }

            .product-options {
                margin-top: 10px;
                line-height: 28px;

                .selected-box {
                    display: flex;
                    flex-wrap: wrap;

                    .selected-tag {
                        margin-right: 20px;
                        padding: 0 20px;
                        height: 30px;
                        line-height: 30px;
                        background-color: snow;
                        border: 1px solid #ddd;

                        .close {
                            margin-left: 20px;
                            color: #f00;
                            cursor: pointer;
                        }
                    }
                }

                dl {
                    margin: 13px 0px;
                    display: flex;

                    dt {
                        margin-right: 15px;
                    }

                    dd {
                        margin-right: 5px;
                        padding: 2px 14px;
                        color: #666;
                        line-height: 24px;
                        border-style: solid;
                        border-width: 1px;
                        border-color: #eee #bbb #bbb #eee;
                    }
                    dd.active {
                        color: #f00;
                    }
                }
                .shopcart{
                    display: flex;
                    .nums{
                        position: relative;
                        margin-right: 15px;
                        width:55px;
                        input{
                            width: 38px;
                            height: 37px;
                            text-align: center;
                            color: #555;
                            border: 1px solid #ddd;
                            outline: none;
                        }
                        span{
                          position: absolute;  
                          right: 0px;
                          width: 15px;
                          height: 18px;
                          text-align: center;
                          line-height: 18px;
                          color: #666;
                          background-color: #f1f1f1;
                          cursor: pointer;
                          user-select: none;
                          &.plus{
                            top: 0px;
                          }
                          &.minus{
                            bottom: 0px;
                          }
                        }
                    }
                    .btn{
                       padding: 0 25px; 
                       height: 36px;
                       text-align: center;
                       line-height: 36px;
                       font-size: 16px;
                       color: #fff;
                       background-color: #e1251b;
                       &:hover{
                        text-decoration: none;
                       }

                    }
                }
            }
        }
    }

    // 侧边栏选项卡、选择搭配、商品介绍
    .product-section {
        margin: 30px auto 0;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;

        // 侧边栏选项卡
        .product-siderbar {
            width: 210px;
            border: 1px solid #ccc;

            .tab-nav {
                display: flex;
                justify-content: space-between;

                .tab-nav-item {
                    width: 105px;
                    border-top: 2px solid #fff;
                    border-bottom: 1px solid #ccc;

                    line-height: 37px;
                    text-align: center;

                    &.active {
                        border-top-color: @btn-red;
                        border-bottom-color: #fff;
                    }
                }

            }

            .tab-panel {
                .tab-panel-item {
                    display: none;
                    padding: 10px;

                    &:first-child {
                        .cates {
                            display: flex;
                            flex-wrap: wrap;

                            li {
                                width: 50%;
                                line-height: 28px;
                                border-bottom: 1px dashed #ededed;
                            }
                        }

                        .products {
                            li {
                                margin: 5px 0 15px;
                                display: flex;
                                flex-direction: column;
                                align-items: center;
                                border-bottom: 1px solid #ededed;

                                img {
                                    width: 152px;
                                }

                                p {
                                    width: 100%;

                                    &.price {
                                        font-size: 16px;
                                        color: #c81623;
                                    }
                                }

                                a {
                                    margin: 5px 0px;
                                    border: 1px solid #8c8c8c;
                                    color: #8c8c8c;
                                    padding: 2px 14px;
                                    line-height: 18px;
                                }
                            }

                        }
                    }

                    &.active {
                        display: block;
                    }
                }
            }
        }

        .product-intro {
            width: 980px;

            //选择搭配
            .product-collocation {
                margin-bottom: 15px;
                border: 1px solid #ddd;

                .choose-title {
                    padding: 5px 0px 5px 15px;
                    color: #333;
                    background-color: #f1f1f1;
                    border-bottom: 1px solid #ddd;
                }

                .choose-content {
                    padding-top: 10px;
                    height: 170px;
                    display: flex;

                    .master-product {
                        position: relative;
                        width: 127px;
                        height: 165px;
                        text-align: center;

                        img {
                            margin: 0 auto;
                            width: 87px;
                        }

                        p {
                            color: #c81623;
                            font-size: 16px;
                        }

                        &::after {
                            content: '+';
                            position: absolute;
                            top: 48px;
                            right: -25px;
                            font-size: 16px;
                        }
                    }

                    .choose-products {
                        width: 668px;
                        height: 165px;
                        display: flex;

                        li {
                            margin: 0 20px;
                            width: 127px;
                            text-align: center;

                            img {
                                width: 120px;
                                height: 130px;
                            }
                        }
                    }

                    .total-products {
                        margin-left: 10px;
                        padding-left: 10px;
                        width: 153px;
                        height: 165px;
                        border-left: 1px solid #ddd;

                        p {
                            margin: 10px 0;

                            &:nth-child(2) {
                                font-weight: 700;
                            }

                            &:nth-child(3) {
                                font-size: 16px;
                                color: #B1191A;
                            }
                        }

                        a {
                            display: inline-block;
                            padding: 10px 25px;
                            font-size: 16px;
                            color: #fff;
                            background-color: #e1251b;

                            &:hover {
                                text-decoration: none;
                            }
                        }
                    }
                }
            }

            // 商品介绍
            .product-intro-tab {
                .tab-nav {
                    display: flex;
                    height: 40px;
                    background: #ededed;
                    border-left: 1px solid #ddd;

                    .tab-nav-item {
                        padding: 0 11px;
                        line-height: 38px;
                        text-align: center;
                        background: #fff;
                        border: 1px solid #ddd;
                        border-left: none;

                        &.active {
                            color: #fff;
                            background-color: @btn-red;
                        }
                    }
                }

                .tab-panel {
                    .tab-panel-item {
                        display: none;

                        &:first-child {
                            ul {
                                li {
                                    margin: 10px 0px;
                                }
                            }
                        }

                        &.active {
                            display: block;
                        }
                    }
                }
            }
        }
    }
}

// 猜你喜欢
.guess-like {
    margin: 15px 0px;

    .wrapper {
        border: 1px solid #ddd;

        .like-title {
            padding: 5px 10px;
            border-bottom: 1px solid #ddd;
            color: #333;
            background-color: #f1f1f1;
        }

        .like-list {
            padding: 15px 11px;
            display: flex;

            .like-item {
                width: 196px;

                img {
                    display: block;
                    margin: 0 auto;
                    width: 167px;
                    height: 123px;
                }

                .title {
                    padding: 0 15px;
                }

                .price {
                    padding: 0 15px;
                    font-size: 16px;
                    color: #c81623;
                    margin-bottom: 20px;
                }

                .comment {
                    padding: 0 15px;
                    text-align: center;
                }
            }
        }
    }
}

// 页脚
.footer {
    background-color: #eaeaea;

    .footer-top {
        padding: 20px;
        border-bottom: 1px solid #e4e1e1;
        display: flex;

        .footer-item {
            h4 {
                font-size: 14px;
            }

            flex: 1 1 0;
            line-height: 18px;
        }
    }

    .footer-bottom {
        padding: 20px;
        text-align: center;

        .footer-nav {
            display: flex;
            justify-content: center;

            span {
                margin: 0 10px;
                width: 1px;
                height: 13px;
                background: #666;
            }
        }

        p {
            margin: 10px 0px;
        }
    }
}
// 固定侧边栏
.page-sidebar{
    position: fixed;
    right: -294px;
    top: 0px;
    width: 300px;
    height: 100%;
    display: flex;
    transition: right .3s ease-in-out 0s;
    .sidebar-nav{
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: flex-end;
        width: 6px;
        background: #7a6e6e;
        .menu-btn{
            width: 35px;
            height: 35px;
            background: #7a6e6e url(../images/list.png) center/cover;
            cursor: pointer;
        }
        .nav-item{
            position: relative;
            width: 35px;
            height: 35px;
            background: #7a6e6e;
            a{
                display:block;
                color: #fff;
                i{
                    display: block;
                    position: relative;
                    z-index: 50;
                    width: 35px;
                    height: 35px;
                    background-color: #7a6e6e;
                    background-image: url(../images/toolbars.png);
                    &.vip-icon {
                        background-position: -87px -174px;
                    }
                    &.shopcar-icon {
                        background-position: -50px -0px;
                    }
                    &.follow-icon {
                        background-position: -50px -100px;
                    }
                    &.history-icon {
                        background-position: -190px -150px;
                    }
                    &.message-icon {
                            background-position: -50px -150px;
                    }
                    &.question-icon {
                        background-position: -50px -250px;
                    }
                    &.top-icon {
                        background-position: -50px -250px;
                    }
                }
                span{
                    position: absolute;
                    left: 35px;
                    top: 0px;
                    width: 62px;
                    height: 35px;
                    text-align: center;
                    line-height: 35px;
                    background-color: #c81122;
                    transition: left .3s ease-in-out 0.1s;
                }
            }
            &:hover {
                background-color: #c81122;
                a{
                    i{
                        background-color: #c81122;
                    }
                    span{
                        left: -60px;
                    }

                }
            }
        }

    }

    .sidebar-content{
        position: relative;
        z-index: 100;
        width: 294px;
        background: bisque;

    }
    &.open{
        right: 0;
        .sidebar-nav{
            .menu-btn{
                background-image: url(../images/cross.png);
            }
        }
    }
    
}